package com.weiiew.backend.entity.config;

import com.weiiew.backend.entity.KeyInfo;
import com.weiiew.backend.entity.TerminationPolicy;
import com.weiiew.backend.executor.KeyboardExecutor;
import lombok.Data;

import java.util.ArrayList;
import java.util.List;

/**
 * 用于存储{@link KeyboardExecutor}的启动配置
 *
 * @author 魏锴
 * @since 2025/4/28
 */
@Data
public class KeyConfig {
    private List<KeyInfo> list;
    private TerminationPolicy policy;
    private String channel; // 消息传递的通道名
    public KeyConfig() {
        this.list = new ArrayList<>();
        this.policy = new TerminationPolicy();
        this.policy.setType(TerminationPolicy.StopType.FOREVER);
        this.channel = "/topic/keyboard-executor";
    }
}
